doctype xml
rss(version="2.0", xmlns:atom="http://www.w3.org/2005/Atom")
  channel
      title= site.name
      atom:link(href="#{site.url}/rss.xml",rel='self',type='application/rss+xml')
      description
      language en-us
      pubDate= site.date.toISOString()
      lastBuildDate= site.date.toISOString()

      each item in getCollection('posts').toJSON()
        item
          title= item.title
          if item.meta.layout == 'link'
            link= item.ref_url
            guid= item.ref_url
          else
            link= site.url + item.url
            guid= site.url + item.url
          pubDate= moment(item.date).utc().format()
          author= site.author
          if item.meta.layout == 'photograph'
            description
              :cdata
                <p><img width="#{item.photograph_max_width}" height="#{item.photograph_max_height}" alt="#{item.title}" src="#{site.url+largepath+item.photograph}"/></p>!{item.contentRenderedWithoutLayouts}
          else
            description
              :cdata
                !{item.contentRenderedWithoutLayouts}